Disable the "inherit value" in the attribute features

DXL scripts to disable the "inherit value" in the attribute features for a specific attribute for all  modules in the project/database


VaniB - Wed Apr 18 00:37:05 EDT 2018

Re: Disable the "inherit value" in the attribute features
Mike.Scharnow - Wed Apr 18 01:04:20 EDT 2018

I understand that it is your task to write a DXL script to switch off inheritance for a specific attribute. Now, what is your problem, where are you stuck in writing your script?

Re: Disable the "inherit value" in the attribute features
VaniB - Wed Apr 18 01:06:11 EDT 2018

I am new to DXL script, don't have any idea how to start with it.......

Re: Disable the "inherit value" in the attribute features
Mike.Scharnow - Wed Apr 18 02:15:46 EDT 2018

VaniB - Wed Apr 18 01:06:11 EDT 2018

I am new to DXL script, don't have any idea how to start with it.......

Well, I won't give you an introduction on how to program DXL, and I doubt anyone else here has the time to do so, and there are rarely people here who have the time to write a complete script for you. Perhaps there are consultants out here that write DXL for bitcoins :)

Note that it is quite dangerous to do something for the complete database, so you should work in a test environment until your script runs perfectly, before you change any productive data. And remember that if you switch off inheritance, it might be that some objects will lose their content. If you want to replace the "empty" value with some "default" value, you have a different task.

 

The general outline for such a script are the following. For all steps there should be enough documentation in the DXL reference manual, in your dxl directory of your client installation and in this or other forums.

  • recursively loop through all projects, folders, sub projects
  • for each folder/project, locate the Formal Modules
  • for each module, try to open it in exclusive edit mode, note that this may fail if the module is already opened or if you are missing enough access rights
  • in the module, locate the AttrDef you are searching for (there is a variant of the "find" command that returns objects of type "AttrDef")
  • for the AttrDef, set the "inherit" property to false to switch inheritance off
  • save and close your module
  • use a lot of print statements to test your script, create your script with an additional mode to simulate the changes, perhaps you want to create a GUI for your script, but this is a lot more complicated, perhaps you want to add some confirmation method for the user who runs the script, but this would be a lot of clicking.